package com.pig4cloud.pigx.admin.api.enums;

public enum MachineTypeEnum {

    UAV("1", "无人机"),
    USHIP("2", "无人船"),
    UNDERWATER("3", "水下设备");

    private String type;
    private String name;

    MachineTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // 根据类型获取名称
    public static String getNameByType(String type) {
        for (MachineTypeEnum machineTypeEnum : MachineTypeEnum.values()) {
            if (machineTypeEnum.getType().equals(type)) {
                return machineTypeEnum.getName();
            }
        }
        return null;
    }
}
